package com.victor.entity.soncompany;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.victor.entity.Department;

import lombok.Data;

/**
 * 子公司表
 * 
 * @author zhangbin
 *
 */
@Entity
@Table(name = "son_company")
@Data
public class Soncompany {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) // 主键类型--自动递增生成
	@Column(name = "id", unique = true, nullable = false, length = 11)
	private Integer id;
	
	@Column(name = "son_name", length = 50)
	private String son_name; // 子公司名称
	
	@Column(name = "son_account", length = 50)
	private String son_account; // 子公司登录账号
	
	@Column(name = "son_password", length = 50)
	private String son_password; // 子公司登录密码
	
	@Column(name = "son_grade", length = 50)
	private String son_grade;//公司等级  0省级  1 市级
	
	@Column(name = "higher_company_id", length = 50)
	private String higher_company_id;//上级公司id 如果该公司等级为 0  上级公司id为0  如果公司为市级公司  则上级为省级公司id

	@Transient
	private List<Department> departments;// 子公司拥有部门

}
